const Mock = require('mockjs')

const data = Mock.mock({
  'items|20': [{
    id: '@id',
    title: '@sentence(20, 30)',
    // 'status|1': ['published', 'draft', 'deleted'],
    'status|1': ['较差', '一般', '良好', '优秀', '史诗', '传说', '不朽', '神器'],
    'damage|1': ['10', '20', '30', '40', '50', '60', '70', '80', '90', '100'],
    author: '@sentence(1, 3)',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)',
    'status1|1': [true, false]
  }]
})

const data2 = Mock.mock({
  'items|20': [{
    id: '@id',
    title: '@sentence(10, 15)',
    // 'status|1': ['published', 'draft', 'deleted'],
    'status|1': ['较差', '一般', '良好', '优秀', '史诗', '传说', '不朽'],
    author: '防具',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)',
    'status1|1': [true, false]
  }]
})

const data4 = Mock.mock({
  'items|20': [{
    id: '@id',
    title: '@sentence(5, 10)',
    // 'status|1': ['published', 'draft', 'deleted'],
    'status|1': ['一般', '良好', '优秀', '史诗', '传说'],
    author: '伙伴',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)',
    'status1|1': [true, false]
  }]
})

const data3 = Mock.mock({
  'items|20': [{
    id: '@id',
    title: '@sentence(10, 10)',
    // 'status|1': ['published', 'draft', 'deleted'],
    'status|1': ['1代', '2代', '3代', '4代', '5代', '6代', '7代', '8代'],
    author: '战车',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)',
    'status1|1': [true, false]
  }]
})

const data5 = Mock.mock({
  'items|20': [{
    id: '@id',
    title: '@sentence(10, 10)',
    'status|1': ['aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg', 'hh'],
    author: 'sdad',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)',
    'status1|1': [true, false]
  }]
})

module.exports = [
  {
    url: '/vue-admin-template/table/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  },
  {
    url: '/vue-admin-template/table/getarmor',
    type: 'get',
    response: config => {
      const items = data2.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  },
  {
    url: '/vue-admin-template/table/getchariot',
    type: 'get',
    response: config => {
      const items = data3.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  },
  {
    url: '/vue-admin-template/table/getpartner',
    type: 'get',
    response: config => {
      const items = data4.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  },
  {
    url: '/vue-admin-template/table/getscene',
    type: 'get',
    response: config => {
      const items = data5.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  }
]
